package com.chenjun.common.util;

import java.io.IOException;
import java.util.Random;
/**
 * 公共方法
 * @author yangl
 *
 */
public class CommonUtil {
	public static final String ALLNUMBER = "0123456789";
	public static final String HTO = "HTO";
	public static final String WX = "WX";

	/**
	 * 获得len位随机数字
	 * @param len 随机数的长度
	 * @return 随机数
	 */
	public static String getRandomNumber(int len){
		Random r=new Random();
		StringBuilder sb=new StringBuilder();
		int charLen=ALLNUMBER.length();
		for (int i = 0; i < len; i++) {
			sb.append(ALLNUMBER.charAt(r.nextInt(charLen)));
		}
		return sb.toString();
	}
}
